As it is generally known in the areas of cryptography and computer security, a man-in-the-middle attack is an attack in which an attacker secretly relays and possibly alters communications between two parties who believe they are communicating directly with each other. One example of a man-in-the-middle attack is active eavesdropping, in which the attacking entity makes independent connections with the communicating parties, and relays messages between the parties to make them believe they are communicating directly with each other over a private connection, while in fact the entire communication session is being controlled by the attacker. To accomplish this, an attacker must be able to intercept all relevant messages passing between the two parties, and to also inject new messages. Such message interception and injection is straightforward under many circumstances. For example, an attacker within reception range of an unencrypted Wi-Fi wireless access point can potentially insert themselves as a man-in-the-middle.
Existing cryptographic protocols include some form of endpoint authentication specifically intended to prevent man-in-the-middle attacks. For example, the TLS (Transport Layer Security) protocol and its predecessor the SSL (Secure Sockets Layer) protocol include authentication of one or both communicating parties within a public key infrastructure (PKI), using a mutually trusted certificate authority (CA). In addition, some existing environments have provided certificate pinning, in which a client attempts to avoid man-in-the-middle attacks by comparing a certificate previously obtained from a server to a certificate subsequently obtained from the same server, and then allowing communication with the server only when there is a match between the two certificates.